export const setObjLocal = (key, obj) => {
  const value = JSON.stringify(obj)
  localStorage.setItem(key, value)
}

export const getObjLocal = key => {
  const value = localStorage.getItem(key)
  try {
    return JSON.parse(value)
  } catch (e) {
    return value
  }
}
